<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .box{
            width: 400px;
            height: 400px;
            background-color: pink;
        }
        .box .inner-box{
            width: 200px;
            height: 200px;
            background-color: green;
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="inner-box">

        </div>
    </div>
    <input type="text">
    <script>
        var box = document.querySelector('.box');
        var innerBox = document.querySelector('.inner-box');
        var input = document.querySelector('input');
        // target 事件触发者 currentTarget 事件绑定者
        box.onclick = function (e) {
            // 鼠标左键0 中键1 右键2
            console.log(e.button);
            console.log('点击了');
            console.log('target', e.target); // inner-box
            console.log('currentTarget', e.currentTarget); // box
        }
        input.onkeyup = function () {
            console.log(event);
            // 按下按键的ASCII码值 回车13
            if (event.keyCode === 13) {
                alert('您输入了' + this.value)
            }
        }
    </script>
</body>
</html>